indexedTests is package{
  -- test various functions of the indexed tables
  
  var R := indexed {
    ("a",1);
    ("b",2);
    ("c",3);
    ("a",4)
  };
  
  var S := indexed of {
    {name="fred"; dept="a"};
    {name="peter"; dept="b"};
  }
  
  main() do {
    logMsg(info,"R=$R");
    logMsg(info,"S=$S");
    
    extend R with ("d",5);
    assert ("d",5) in R;
    assert (all X where ("d",X) in R) = array of {5};
    
    X is _fold(R, (function((U,V),S) is S+V), 0);
    logMsg(info,"X=$X");
    assert X=15; 
  }
}